﻿namespace FinalPointSet.Model.Model.MockData
{
    public class MockFieldMappingRule
    {
        /// <summary>
        /// ID
        /// </summary>
        public int ID { get; set; } = -1;
        /// <summary>
        /// 规则名称
        /// </summary>
        public string Name { get; set; } = string.Empty;
        /// <summary>
        /// 映射匹配的类型
        /// </summary>
        public MappingMatchType MappingMatchType { get; set; } = MappingMatchType.Keyword;
        /// <summary>
        /// 字段名称中的关键词
        /// </summary>
        public string Keyword { get; set; } = string.Empty;
        /// <summary>
        /// 要求字段划分类型
        /// </summary>
        public ClassfiyType ClassfiyType { get; set; } = ClassfiyType.Other;
        /// <summary>
        /// 目标脚本ID
        /// </summary>
        public int RuleID { get; set; } = -1;
        /// <summary>
        /// 排序值
        /// </summary>
        public int Sequence { get; set; } = 0;
        public MockFieldMappingRule() { }

        public MockFieldMappingRule(int id, string name, MappingMatchType mappingMatchType, string keyword, ClassfiyType classfiyType, int ruleID, int sequence)
        {
            ID = id;
            Name = name;
            MappingMatchType = mappingMatchType;
            Keyword = keyword;
            ClassfiyType = classfiyType;
            RuleID = ruleID;
            Sequence = sequence;
        }

        public override string? ToString()
        {
            return $"ID={ID},Name={Name},MappingMatchType={MappingMatchType},Keyword={Keyword},ClassfiyType={ClassfiyType},RuleID={RuleID},Sequence={Sequence}";
        }
    }
}
